{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">编辑班级</h3>
	<table class="layui-table layui-table-form">
		<tr><td class="layui-td-gray-2">年级<font>*</font></td>
			<td><input type="text" name="grade"  lay-verify="required" lay-reqText="请完善年级" value="{$detail.grade}" autocomplete="off" placeholder="请输入年级" class="layui-input"></td><td class="layui-td-gray-2">班级<font>*</font></td>
			<td><input type="text" name="bj_name"  lay-verify="required" lay-reqText="请完善班级" value="{$detail.bj_name}" autocomplete="off" placeholder="请输入班级" class="layui-input"></td><td class="layui-td-gray-2">年级课程<font>*</font></td>
			<td><input type="text" name="course_grade"  lay-verify="required" lay-reqText="请完善年级课程" value="{$detail.course_grade}" autocomplete="off" placeholder="请输入年级课程" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">课程id<font>*</font></td>
			<td><input type="text" name="course_id"  lay-verify="required" lay-reqText="请完善课程id" value="{$detail.course_id}" autocomplete="off" placeholder="请输入课程id" class="layui-input"></td><td class="layui-td-gray-2">班级简称</td>
			<td><input type="text" name="bj_name_s"  value="{$detail.bj_name_s}" autocomplete="off" placeholder="请输入班级简称" class="layui-input"></td><td class="layui-td-gray-2">班级编号<font>*</font></td>
			<td><input type="text" name="bj_code"  lay-verify="required" lay-reqText="请完善班级编号" value="{$detail.bj_code}" autocomplete="off" placeholder="请输入班级编号" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">班主任</td>
			<td><input type="text" name="headteacher"  value="{$detail.headteacher}" autocomplete="off" placeholder="请输入班主任" class="layui-input"></td><td class="layui-td-gray-2">状态<font>*</font></td>
			<td>				<input type="radio" name="status" value="0" title="禁用" {eq name="$detail.status" value="禁用"} checked{/eq}>
				<input type="radio" name="status" value="1" title="正常" {eq name="$detail.status" value="正常"} checked{/eq}>
				<input type="radio" name="status" value="-1" title="删除" {eq name="$detail.status" value="删除"} checked{/eq}></td><td colspan='2'></td>
		</tr>
	</table>
	<div class="py-3">
		<input type="hidden" name="id" value="{$detail.id}"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/user_class/edit", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->